import socket
socket_server = socket.socket()
socket_server.bind(('127.0.0.1', 8080))
socket_server.listen(5)
conn,address = socket_server.accept()
print(f"访问地址为：{address}")
while True:
    data = conn.recv(1024).decode("UTF-8")
    print(f"接收到的数据为：{data}")
    msg=input("请输入要发送的数据：")
    if msg == "exit":
        break
    conn.send(msg.encode("UTF-8"))
conn.close()
socket_server.close()
